<script>
	import {checkLogin} from "./libs/login";
	import {HTTP_REQUEST_URL} from './config/app';
	import Auth from './libs/wechat.js';
	import Routine from './libs/routine.js';
	import Apps from './libs/apps.js';
	import {mapActions} from 'vuex'
	// #ifdef APP-PLUS
	import APPUpdate from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
	// #endif
	// const app = getApp();
	export default {
		globalData: {
			spread: 0,
			code: 0,
			isLogin: false,
			userInfo: {},
			MyMenus: [],
			windowHeight: 0,
			navHeight:0,
			navH:0,
			id: 0,
			isIframe: false,
			theme:'theme1',
		},
		onLaunch: function(option) {
			
		
			let that = this;
			// 隐藏原生的tabbar
			uni.hideTabBar();
		
			// 获取导航高度；
			uni.getSystemInfo({
				success: function(res) {
					that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
				}
			});
		
			// #ifdef MP-ALIPAY
			// 小程序静默授权
			if (!this.$store.getters.isLogin) {
				Routine.getAliCode().then(code => {
					Routine.authUserInfoAliPay(code)
				})
				.catch(res => {
					uni.hideLoading();
				});
			};
			// #endif
		
			uni.switchTab({
				url:"/pages/index/index",
				complete(res) {
					console.log(444,res)
				}
			})
		},
		async mounted() {
			if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) await this.$store.dispatch('USERINFO');
		},
		methods: {},
		onShow: function() {
			// this.$Common.xrLogin();
			// #ifdef H5
			uni.getSystemInfo({
				success(e) {
					/* 窗口宽度大于420px且不在PC页面且不在移动设备时跳转至 PC.html 页面 */
					if (e.windowWidth > 420 && !window.top.isPC && !/iOS|Android/i.test(e.system)) {
						// window.location.pathname = 'https://java.net/';
						/* 若你的项目未设置根目录（默认为 / 时），则使用下方代码 */
						window.location.pathname = '/static/html/pc.html';
					}
				}
			})
			// #endif
			
			
		},
		onHide: function() {}
	}
</script>
<style lang="scss">
	@import url("@/plugin/animate/animate.min.css");
	@import 'static/css/base.css';
	@import 'static/css/guildford.css';
	@import 'static/css/style.scss'; 
    @import 'static/iconfont/xr_iconfont/iconfont.css';
	@import 'static/iconfont/qsbs_iconfont/iconfont.css';
	
	@import 'static/iconfont/iconfont.css';
	

	
	/* 条件编译，仅在H5平台生效 */
	// #ifdef H5
	body::-webkit-scrollbar,
	html::-webkit-scrollbar {
		display: none;
	}

	// #endif
	view {
		box-sizing: border-box;
	}

	.bg-color-red {
		background-color: #E93323;
	}

	.syspadding {
		padding-top: var(--status-bar-height);
	}

	.flex {
		display: flex;
	}

	.uni-scroll-view::-webkit-scrollbar {
		/* 隐藏滚动条，但依旧具备可以滚动的功能 */
		display: none
	}

	::-webkit-scrollbar {
		width: 0;
		height: 0;
		color: transparent;
	}
</style>
